Optimal. Leaf size=366 \[ -\frac {C \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x))^{1+n}}{d f (2+m+n)}+\frac {\sqrt {2} (c (C+2 C m)+d (C (1-m+n)+A (2+m+n))) F_1\left (\frac {1}{2}+m;\frac {1}{2},-n;\frac {3}{2}+m;\frac {1}{2} (1+\sin (e+f x)),-\frac {d (1+\sin (e+f x))}{c-d}\right ) \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n}}{d f (1+2 m) (2+m+n) \sqrt {1-\sin (e+f x)}}+\frac {\sqrt {2} C (d m-c (1+m)) F_1\left (\frac {3}{2}+m;\frac {1}{2},-n;\frac {5}{2}+m;\frac {1}{2} (1+\sin (e+f x)),-\frac {d (1+\sin (e+f x))}{c-d}\right ) \cos (e+f x) (a+a \sin (e+f x))^{1+m} (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n}}{a d f (3+2 m) (2+m+n) \sqrt {1-\sin (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.55, antiderivative size = 365, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 6, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.162, Rules used = {3125, 3066,
2867, 145, 144, 143} \begin {gather*} \frac {\sqrt {2} \cos (e+f x) (a \sin (e+f x)+a)^m (A d (m+n+2)+c (2 C m+C)+C d (-m+n+1)) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n} F_1\left (m+\frac {1}{2};\frac {1}{2},-n;m+\frac {3}{2};\frac {1}{2} (\sin (e+f x)+1),-\frac {d (\sin (e+f x)+1)}{c-d}\right )}{d f (2 m+1) (m+n+2) \sqrt {1-\sin (e+f x)}}+\frac {\sqrt {2} C (d m-c (m+1)) \cos (e+f x) (a \sin (e+f x)+a)^{m+1} (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n} F_1\left (m+\frac {3}{2};\frac {1}{2},-n;m+\frac {5}{2};\frac {1}{2} (\sin (e+f x)+1),-\frac {d (\sin (e+f x)+1)}{c-d}\right )}{a d f (2 m+3) (m+n+2) \sqrt {1-\sin (e+f x)}}-\frac {C \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x))^{n+1}}{d f (m+n+2)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 143
Rule 144
Rule 145
Rule 2867
Rule 3066
Rule 3125
Rubi steps
\begin {align*} \int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (A+C \sin ^2(e+f x)\right ) \, dx &=-\frac {C \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x))^{1+n}}{d f (2+m+n)}+\frac {\int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n (a (A d (2+m+n)+C (d+c m+d n))+a C (d m-c (1+m)) \sin (e+f x)) \, dx}{a d (2+m+n)}\\ &=-\frac {C \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x))^{1+n}}{d f (2+m+n)}+\frac {(C (d m-c (1+m))) \int (a+a \sin (e+f x))^{1+m} (c+d \sin (e+f x))^n \, dx}{a d (2+m+n)}+\frac {(c (C+2 C m)+C d (1-m+n)+A d (2+m+n)) \int (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \, dx}{d (2+m+n)}\\ &=-\frac {C \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x))^{1+n}}{d f (2+m+n)}+\frac {(a C (d m-c (1+m)) \cos (e+f x)) \text {Subst}\left (\int \frac {(a+a x)^{\frac {1}{2}+m} (c+d x)^n}{\sqrt {a-a x}} \, dx,x,\sin (e+f x)\right )}{d f (2+m+n) \sqrt {a-a \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}+\frac {\left (a^2 (c (C+2 C m)+C d (1-m+n)+A d (2+m+n)) \cos (e+f x)\right ) \text {Subst}\left (\int \frac {(a+a x)^{-\frac {1}{2}+m} (c+d x)^n}{\sqrt {a-a x}} \, dx,x,\sin (e+f x)\right )}{d f (2+m+n) \sqrt {a-a \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\\ &=-\frac {C \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x))^{1+n}}{d f (2+m+n)}+\frac {\left (a C (d m-c (1+m)) \cos (e+f x) \sqrt {\frac {a-a \sin (e+f x)}{a}}\right ) \text {Subst}\left (\int \frac {(a+a x)^{\frac {1}{2}+m} (c+d x)^n}{\sqrt {\frac {1}{2}-\frac {x}{2}}} \, dx,x,\sin (e+f x)\right )}{\sqrt {2} d f (2+m+n) (a-a \sin (e+f x)) \sqrt {a+a \sin (e+f x)}}+\frac {\left (a^2 (c (C+2 C m)+C d (1-m+n)+A d (2+m+n)) \cos (e+f x) \sqrt {\frac {a-a \sin (e+f x)}{a}}\right ) \text {Subst}\left (\int \frac {(a+a x)^{-\frac {1}{2}+m} (c+d x)^n}{\sqrt {\frac {1}{2}-\frac {x}{2}}} \, dx,x,\sin (e+f x)\right )}{\sqrt {2} d f (2+m+n) (a-a \sin (e+f x)) \sqrt {a+a \sin (e+f x)}}\\ &=-\frac {C \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x))^{1+n}}{d f (2+m+n)}+\frac {\left (a C (d m-c (1+m)) \cos (e+f x) \sqrt {\frac {a-a \sin (e+f x)}{a}} (c+d \sin (e+f x))^n \left (\frac {a (c+d \sin (e+f x))}{a c-a d}\right )^{-n}\right ) \text {Subst}\left (\int \frac {(a+a x)^{\frac {1}{2}+m} \left (\frac {a c}{a c-a d}+\frac {a d x}{a c-a d}\right )^n}{\sqrt {\frac {1}{2}-\frac {x}{2}}} \, dx,x,\sin (e+f x)\right )}{\sqrt {2} d f (2+m+n) (a-a \sin (e+f x)) \sqrt {a+a \sin (e+f x)}}+\frac {\left (a^2 (c (C+2 C m)+C d (1-m+n)+A d (2+m+n)) \cos (e+f x) \sqrt {\frac {a-a \sin (e+f x)}{a}} (c+d \sin (e+f x))^n \left (\frac {a (c+d \sin (e+f x))}{a c-a d}\right )^{-n}\right ) \text {Subst}\left (\int \frac {(a+a x)^{-\frac {1}{2}+m} \left (\frac {a c}{a c-a d}+\frac {a d x}{a c-a d}\right )^n}{\sqrt {\frac {1}{2}-\frac {x}{2}}} \, dx,x,\sin (e+f x)\right )}{\sqrt {2} d f (2+m+n) (a-a \sin (e+f x)) \sqrt {a+a \sin (e+f x)}}\\ &=-\frac {C \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x))^{1+n}}{d f (2+m+n)}+\frac {\sqrt {2} (c (C+2 C m)+C d (1-m+n)+A d (2+m+n)) F_1\left (\frac {1}{2}+m;\frac {1}{2},-n;\frac {3}{2}+m;\frac {1}{2} (1+\sin (e+f x)),-\frac {d (1+\sin (e+f x))}{c-d}\right ) \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n}}{d f (1+2 m) (2+m+n) \sqrt {1-\sin (e+f x)}}+\frac {\sqrt {2} C (d m-c (1+m)) F_1\left (\frac {3}{2}+m;\frac {1}{2},-n;\frac {5}{2}+m;\frac {1}{2} (1+\sin (e+f x)),-\frac {d (1+\sin (e+f x))}{c-d}\right ) \cos (e+f x) \sqrt {1-\sin (e+f x)} (a+a \sin (e+f x))^{1+m} (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c-d}\right )^{-n}}{d f (3+2 m) (2+m+n) (a-a \sin (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(1873\) vs. \(2(366)=732\).
time = 8.10, size = 1873, normalized size = 5.12 \begin {gather*} \text {Too large to display} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 1.43, size = 0, normalized size = 0.00 \[\int \left (a +a \sin \left (f x +e \right )\right )^{m} \left (c +d \sin \left (f x +e \right )\right )^{n} \left (A +C \left (\sin ^{2}\left (f x +e \right )\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \left (C\,{\sin \left (e+f\,x\right )}^2+A\right )\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^m\,{\left (c+d\,\sin \left (e+f\,x\right )\right )}^n \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________